var io = require("socket.io")({
  path: '',
  transports: ['websocket']
});

io.on("connection", socket => {
  socket.on("message", msg => {
    console.log(socket.id + " : " + msg);

    socket.emit("message", "hello client" + msg);
  });

  socket.on('disconnect', () => {
    console.log("client(" + socket.id + ") closed ");
  });
});

io.listen(8001);

console.log("listen on 8001");
